/**
 * Created by wanglei on 2016/4/11.
 * 个人中心路由配置
 */

function routecfg($locationProvider, $httpProvider, $stateProvider, $urlRouterProvider) {
    //首页面状态
    $stateProvider.state("main", {
        url: "/main",
        templateUrl: "/views/main.html",
        controller: "mainCtrl"
    });

    //登录注册模块
    $stateProvider.state("login", {
        url: "/login",
        templateUrl: "/views/login.html",
        controller: "loginCtrl"
    })
    //注册
        .state("register", {
            url: "/register",
            templateUrl: "/views/register.html",
            controller: "registerCtrl",
            title: "登录注册"
        })
        //产品列表
        .state("productList", {
            url: "/productList",
            templateUrl: "/views/product-list.html",
            controller: "productListCtrl",
            title: "产品列表"
        })
        //产品详情
        .state("listDetail", {
            url: "/listDetail/{productId}",
            templateUrl: "/views/list-detail.html",
            controller: "listDetailCtrl",
            title: "产品详情"
        })
        //产品详情
        .state("productDetail", {
            url: "/productDetail/{productId}",
            templateUrl: "/views/product-detail.html",
            controller: "productDetailCtrl",
            title: "理财详情"
        })
        //我的理财
        .state("myFinance", {
            url: "/myFinance",
            templateUrl: "/views/my-finance.html",
            controller: "myFinanceCtrl",
            title: "我的理财"
        })
        //我的收益
        .state("myEarn", {
            url: "/myEarn",
            templateUrl: "/views/my-earn.html",
            controller: "myEarnCtrl",
            title: "我的收益"
        })
        //收益详情
        .state("earnDetail", {
            url: "/earnDetail",
            templateUrl: "/views/earn-detail.html",
            controller: "earnDetailCtrl",
            title: "收益详情"
        })
        //客服人员
        .state("servicer", {
            url: "/servicer",
            templateUrl: "/views/servicer.html",
            controller: "servicerCtrl",
            title: "客服专员"
        })
        //项目介绍
        .state("projectIntroduct", {
            url: "/projectIntroduct",
            templateUrl: "/views/project-introduct.html",
            controller: "projectIntroductCtrl",
            title: "项目介绍"
        })
        //项目介绍
        .state("tips1", {
            url: "/tips1",
            templateUrl: "/views/tips1.html",
            controller: "tipsCtrl",
            title: "登录注册"
        })
        //项目介绍
        .state("tips2", {
            url: "/tips2",
            templateUrl: "/views/tips2.html",
            controller: "earnDetailCtrl",
            title: "我的投资"
        })
        //项目介绍
        .state("map", {
            url: "/map",
            templateUrl: "/views/map.html",
            controller: "mapCtrl",
            title: "我的位置"
        })

    ;
    //默认状态下路由转向登录页面
    $urlRouterProvider.otherwise("/myFinance");
    //商品部分路由
    $locationProvider.html5Mode({
        enabled: true,
        requireBase: false
    });


    $httpProvider.defaults.withCredentials = true;

    $httpProvider.defaults.headers.post["Content-Type"] = "application/json";


}

routecfg.$inject = ["$locationProvider", "$httpProvider", "$stateProvider", "$urlRouterProvider"];
export default routecfg

